The present invention relates generally to the generation and utilization of logged messages in an embedded computer system, and more particularly relates to systems and methods for forwarding the logged messages within and outside of the embedded system, and controlling the priority of the logging activity within the embedded system.
Computers have evolved from the traditional stand-alone type of computer to computer systems utilizing multiple computers distributed throughout a network. Some of these distributed computer systems are formed solely of traditional computers. Traditional computers typically have the following characteristics:
being general purpose, rather than designed to perform one specific computational task;
having their own, dedicated interface, usually with some interface for a human operator. Again, the interface is usually general purpose; and
being physically distinct from machines intended for other, non-computational purposes, that they may interact with. However, other computer systems are formed solely or include as part(s) thereof, so-called xe2x80x9cembeddedxe2x80x9d computers. An embedded computer is part of a larger machine and is specifically designed to operate with that machine. Embedded computer applications have unique requirements, typically including reduced power consumption and small physical size, to support portable or mobile use or installation in a confined space within the larger machine. Reduced heat dissipation is another common requirement, for either mobile or portable use or installation within a larger machine.
To meet these requirements, embedded computers generally use highly integrated processors, custom-designed hardware, and are scaled to minimize memory usage and provide high reliability.
Embedded computers also typically do not utilize a direct user interface, and therefore impose constraints on input and output of data. System events or error messages still need to be communicated from the embedded computer (or xe2x80x98loggedxe2x80x99) to some destination where they can be acted upon, viewed or stored for later viewing. The destination may be another embedded or non-embedded computer within the overall system they are all a part of.
The capability to filter these logged messages is also required. That is, the capability to discard some of the messages (either at the source or at an intermediate or final destination), based on whether they record a type of event that is currently of interest. What kind of events are of interest may change, depending on the current state of the system or of the individual embedded computer that is producing the message. For example, whether the system or individual computer is being tested or used in full deployment, or has recently encountered a problem may affect which messages are of interest.
A current message logging system, provided by one Operating System for embedded computer systems, provides a logged message which includes a single piece of text data that is directed from the embedded computer via the Operating System""s standard output mechanism for displaying text messages. This requires a device be available locally, to receive the output and display it. The logging is also performed without any filtering of the logged messages. The single piece of text data, in fact, does not distinguish any specific pieces of information or mandate that any particular information be contained within it which could be utilized for filtering (such as the importance of the message or its source).
Thus there is a need for a reliable and flexible logging of error and other system events which allows messages to be filtered and forwarded to different destinations as desired.
Stated generally, the present invention provides customizable and flexible handling of errors, warnings, and embedded computer system events as logged messages. The system accepts logged messages concurrently from any number of parts of the application software. (Any code, running on any number of Operating System threads or tasks.)
The messages are written into a message queue, from which each message is then read and passed to a xe2x80x9cmessage forwarder.xe2x80x9d (Both the queue and forwarder reside locally on the embedded computer where the message was logged.) Rather than including only a single piece of text data, the messages are structured into multiple data fields, some of which are text strings and some of which are other data types, such as integers and time values.
The message forwarder analyzes one or more of the data fields of the message in order to decide whether to forward a particular message. In the event that the message will be forwarded, the forwarder also determines which destination or destinations to forward it to, which data fields from the logged message will be forwarded, and how those fields will be formatted (i.e., how their data will be presented) when forwarded. The forwarder even has the opportunity to transform the values of any of the data fields in the message, or to supplement them with additional data that is available to the forwarder.
The forwarder code that is executed may be specified by an application. This gives the application total control over which messages are filtered out (i.e. not forwarded), and for the messages that are forwarded, what data is forwarded and how it is formatted.
The forwarder code executes on its own Operating System thread or task, rather than the Operating System threads or tasks that the application code that logs the messages runs on. This decouples the continued execution of the application (after a call is made to log a message) from the process of forwarding the messages to their destination or destinations. The system provides a way to configure the priority of the Operating System thread or task that the forwarder executes on, and hence to control the priority of the logging activity relative to the other activities being performed on the same machine.